<template>
	<view class="container">
		<image v-for="(img,index) in swipers" :key="index" :src="img.AdsImg" class="w-100" mode="widthFix"></image>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				swipers:[]
			};
		},
		async onLoad() {
			//获取广告数据
			this.getAds();
		},
		methods: {
			//获取广告数据
			getAds() {
				let that = this;
				let whe=[];
				whe.push({
					"name": "AdsType",
					"value": 5,
					"displayType": 'text'
				});
				let cateOp = {
					url: "api/Lx_Self_Ads/UI_GetPageData",
					data: {
						"page": 1,
						"rows": 20,
						"sort": "CreateDate",
						"order": "desc",
						"wheres": JSON.stringify(whe)
					}
				}
					
				this.$request.Post(cateOp, (ret) => {
					if (ret.rows.length > 0) {
						that.swipers=[];
						that.swipers = ret.rows;
						that.swipers.map(n=>{
							n.AdsImg=that.$request.setImgUrl(n.AdsImg,"ttt");
							return n;
						});
				
					}
				});
			},
		}
	}
</script>

<style lang="scss">

</style>
